# --*-- coding:utf8 --*--
import os
from collections import namedtuple
from tools.path import cur_path

CURPATH = cur_path()
filepath = os.path.join(CURPATH, "合并测试数据统计报告.xls")
start_date = None
end_date = None

# TODO 后面需要用namedtuple来改写下面的values中二级字典
# statistics = namedtuple('statistics', ["用例总数","用例执行成功数","用例执行失败数","用例执行总数",
#                                             "总测试轮次","提示缺陷总数","缺陷总数 "])

automated_values = {
    '自动化测试数据统计':
    # one,two,three,version,服务接口个数,新增接口个数,用例总数,用例执行成功个数,用例执行失败个数,
    # 用例执行总数,测试总轮次,缺陷总数;
        {"colflag": [0, 1, 2, 3, 5, 6, 9, 10, 11, 12, 13, 20],
         "colname": [
             "自动化服务接口个数",
             "自动化新增接口个数",
             "自动化用例总数",
             "自动化用例执行成功个数",
             "自动化用例执行失败个数",
             "自动化用例执行总数",
             "自动化测试总轮次",
             "自动化测试缺陷总数"
         ]
         }
}

compatibility_values = {
    # one,two,three,version,配额消耗,通过率,总场景数,执行兼容性场景数,兼容性测试总轮次,缺陷总数
    '兼容性测试数据统计':
        {"colflag": [0, 1, 2, 3, 8, 9, 11, 12, 13, 25],
         "colname": [
             "兼容性配额消耗",
             "兼容性通过率",
             "兼容性总场景数",
             "兼容性执行兼容性场景数",
             "兼容性测试总轮次",
             "兼容性缺陷总数"
         ]
         }
}

destructive_values = {
    # one,two,three,version,总场景数,总轮次,新设计破坏性场景数,执行破坏性场景数,缺陷总数
    '破坏性测试数据统计':
        {"colflag": [0, 1, 2, 3, 7, 8, 10, 11, 16],
         "colname": [
             "破坏性测试总场景数",
             "破坏性测试总轮次",
             "破坏性测试新设计破坏性场景数",
             "破坏性测试执行破坏性场景数",
             "破坏性测试缺陷总数",
         ]
         }

}

function_values = {
    # '''one,two,three,version,服务接口个数,新增接口个数,功能测试总轮次,新设计手工用例数,手工用例总数,新设计自动化用例数，
    # 自动化用例总数,总用例数,执行自动化用例数,执行手工用例数,用例执行总数,致命缺陷数量,严重缺陷数量,一般缺陷数量,提示缺陷数量,
    # 缺陷总数,已关闭缺陷数量,未关闭缺陷数量'''
    '功能测试数据统计':
        {"colflag": [0, 1, 2, 3, 5, 6, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25],
         "colname": [
             "功能测试服务接口个数",
             "功能测试新增接口个数",
             "功能测试总轮次",
             "功能测试新设计手工用例数",
             "功能测试手工用例总数",
             "功能测试新设计自动化用例数",
             "功能测试自动化用例总数",
             "功能测试统计表总用例数",
             "功能测试执行自动化用例数",
             "功能测试执行手工用例数",
             "功能测试用例执行总数",
             "功能测试致命缺陷数量",
             "功能测试严重缺陷数量",
             "功能测试一般缺陷数量",
             "功能测试提示缺陷数量",
             "功能测试缺陷总数",
             "功能测试已关闭缺陷数量",
             "功能测试未关闭缺陷数量"
         ]
         }
}

performance_values = {
    # one,two,three,version,服务接口个数,新增接口个数,总场景数,新设计性能场景数,执行性能场景数,测试总轮次,缺陷总数
    '性能测试数据统计':
        {"colflag": [0, 1, 2, 3, 5, 6, 9, 10, 11, 12, 18],
         "colname": [
             "性能测试服务接口个数",
             "性能测试新增接口个数",
             "性能测试总场景数",
             "性能测试新设计性能场景数",
             "性能测试执行性能场景数",
             "性能测试测试总轮次",
             "性能测试缺陷总数"
         ]
         }
}

production_performance_values = {
    # one,two,three,version,服务接口个数,新增接口个数,总场景数,新设计性能场景数,执行性能场景数,测试总轮次,缺陷总数
    '生产性能测试数据统计':
        {"colflag": [0, 1, 2, 3, 5, 6, 9, 10, 11, 12, 18],
         "colname": [
             "生产性能测试服务接口个数",
             "生产性能测试新增接口个数",
             "生产性能测试总场景数",
             "生产性能测试新设计性能场景数",
             "生产性能测试执行性能场景数",
             "生产性能测试测试总轮次",
             "生产性能测试缺陷总数"
         ]
         }
}
